//
//  ViewController.m
//  ZFJFormKit
//
//  Created by 张福杰 on 2018/4/22.
//  Copyright © 2019 张福杰. All rights reserved.
//

#import "ViewController.h"
#import "WeChatFoundViewController.h"
#import "SetInforsViewController.h"
#import "CustomHeaderViewController.h"
#import "ZFJFormKit.h"

@interface ViewController ()

@property (nonatomic,strong) NSMutableArray<ZFJFormModel *> *dataArray;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //[self uiConfig];
    //[self dataConfig];
    [self uiConfig_new];
}

- (void)uiConfig_new{
    NSArray *titleArray = @[@"微信发现页面", @"填写基本信息", @"自定义头部/尾部"];
    for (int i = 0; i<titleArray.count; i++) {
        UIButton *button = [[UIButton alloc] init];
        [button setTitle:titleArray[i] forState:UIControlStateNormal];
        button.frame = CGRectMake((ZFJForm_ScreenWidth - 200)/2, 100 + (50 + 50) * i, 200, 50);
        button.backgroundColor = [UIColor lightGrayColor];
        [button setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
        [self.view addSubview:button];
        [button addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
        button.tag = 100 + i;
    }
}

- (void)buttonClick:(UIButton *)button{
    if(button.tag == 100){
        WeChatFoundViewController *wvc = [[WeChatFoundViewController alloc] init];
        UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:wvc];
        [self presentViewController:nvc animated:YES completion:nil];
    }else if (button.tag == 101){
        SetInforsViewController *wvc = [[SetInforsViewController alloc] init];
        UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:wvc];
        [self presentViewController:nvc animated:YES completion:nil];
    }else{
        CustomHeaderViewController *wvc = [[CustomHeaderViewController alloc] init];
        UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:wvc];
        [self presentViewController:nvc animated:YES completion:nil];
    }
}

@end
